<% content_for :head_hook do %>
  <style type="text/css">
    body { width:180px; overflow: hide; }
  </style>
<% end %>

<% content_for :on_ready_hook do %>
  $("a.add_to_editor").click(function() {
    var url = $(this).attr('data-url');
    parent.$.GollumEditor.replaceSelection("![](" + url + ")");
  });
<% end %>
<%= render :template => 'images/new' %>

<%= image_tag @image.file.url, :width => 64, :height => 64 %>
<%= link_to t(:add_to_content), 'javascript:;', :class => "add_to_editor", "data-url" => @image.file.url %>

